package com.matongxue.springboot;

import java.util.concurrent.*;

class Task1 extends  Thread{
    @Override
    public void run() {

    }
}

class Task2 implements Runnable{

    @Override
    public void run() {

    }
}

class Task3 implements Callable<Long> {


    @Override
    public Long call() throws Exception {
        return null;
    }
}

public class ThreadTest {
    public static void main(String[] args) {
//        Task1 task= new Task1();
//        task.start();
//
//        new Thread(new Task2()).start();
//
//        ExecutorService executorService = Executors.newFixedThreadPool(20);
//
//        FutureTask<Long> future = (FutureTask<Long>) executorService.submit(new Task3());

        Thread t = new Thread() {
            public void run() {
                pong();
            }
        };
        t.run();
        System.out.println(Thread.currentThread().getName()+" ping");
    }

    static void pong() {
        System.out.println(Thread.currentThread().getName()+" pong");
    }



}
